<%@page import="gandalf.model.Stranka"%>
<%@page import="gandalf.controller.StrankaJpaController"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>

<html>
    <head>
        <meta charset="utf-8">
        <title>Prodaja vstopnic - Gandalf</title>
        <link rel="stylesheet" href="css/style.css" type="text/css" media="screen, projection">
        <link rel="stylesheet" href="blueprint/src/forms.css" type="text/css" media="screen, projection">
    </head>
    <%

                    Long idStranke = (Long) request.getSession().getAttribute("stranka_id");
                    StrankaJpaController strankaDao = new StrankaJpaController();
                    Stranka stranka = null;
                    if (idStranke != null) {
                        stranka = strankaDao.findStranka(idStranke);
                    }

        %>
    <body>
        <div id="header">
            <h1 id="logo">Gandalf</h1>
            <ul id="nav">
                <li><a href="index.jsp">Dogodki</a></li>
                <li><a href="mailto:gandalf_support@gmail.com">Kontakt</a></li>
                <li><a href="<%= stranka != null ? "logout.jsp" : "login.jsp"%>">
                        <%= stranka != null ? "Odjava" : "Prijava"%></a></li>
            </ul>
        </div><!-- header -->
        <div id="section" class="container">
            <form action="Dogodek" method="POST">
                <ul>
                    <li>
                        <label for="naziv">Ime dogodka</label><br>
                        <input class="title" type="text" name="naziv" value="">
                    </li>
                    <li>
                        <label for="opis">Dodatne informacije o dogodku</label><br>
                        <textarea name="opis" rows="4" cols="20"></textarea>
                    </li>
                    <li>
                        <label for="datum">Datum</label><br>
                        <input type="text" name="datum" value="">

                        <label for="ura">Ura</label>
                        <select name="ura">
                            <% for(int i = 0; i < 24; i++) { %>
                                <option><%= (i/10 == 0 ? "0" + i : i) %></option>
                            <% } %>
                        </select>
                        <select name="minute">
                            <% for(int i = 0; i < 60; i++) { %>
                                <option><%= (i/10 == 0 ? "0" + i : i) %></option>
                            <% } %>
                        </select>
                    </li>
                    <li>
                        <label for="opis">Kategorija</label>
                        <select name="kategorija">
                            <option>Koncerti</option>
                            <option>Festivali</option>
                            <option>Gledališče</option>
                        </select>
                    </li>
                    <li>
                        <label for="objavljen">Objavljen</label><br>
                        <input type="checkbox" name="objavljen" value="1" />
                    </li>
                </ul>
                <input name="submit" type="submit" value="Shrani">
            </form>
        </div>
    </body>
</html>
